<?php

namespace App\Services;

use App\Models\MemberModel;

class MemberService
{
    private $model;

    public function __construct()
    {
        $this->model = new MemberModel();
    }

    public function getMemberInfoByNumber(string $number)
    {
        $info = $this->model->where([
            'number' => $number
        ])->first();
        return $info;
    }

    public function passEncode($password)
    {
        return password_hash($password, PASSWORD_DEFAULT);
    }

    public function passCheck($password, $hash)
    {
        return password_verify($password, $hash);
    }
}
